<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>history和location</title>
</head>
<body>
<script>
    /*location 地址栏对象
    * 获取:使用window.location获取,其中window.可以省略
    *
    * window.location.属性 == location.属性
    *
    * 属性:href:设置或返回完整的URL
    *
    * location.href = "http://www.itcast.cn"
    * */

    console.log(window.location.href);

    // 3秒后跳转百度
    // function jumpBaidu() {
    //     window.location.href = "http://www.baidu.com"//给location.href赋值就是跳转
    // }
    //
    // window.setTimeout(jumpBaidu, 3000);

</script>

<!--history-->
<a href="learnJS11_2.html">去learnJS11_2.html</a>
<button onclick="goAhead()">代码让我往前走</button>

<script>
    function goAhead() {
        window.history.forward()
    }
</script>
</body>
</html>